<template>
    <div>
        <div class="form-section">
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>交底名称</label>
                </div>
                <div>
                    <p>卡卡萨</p>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>交底范围</label>
                </div>
                <div>
                    <p>2019-03-11</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>交底时间</label>
                </div>
                <div>
                    <p>思考的反馈水电费</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>交底人</label>
                </div>
                <div>
                    <p>卡卡萨</p>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>交底内容</label>
                </div>
                <div>
                    <p class="textarea">卡卡萨</p>
                </div>
            </div>
        </div>
        <div class="cut-off-rule"></div>
        <div class="form-section">
            <h3>附件信息</h3>
            <div class="form-item form-item-style1"
                 @click="preview()">
                <!-- @click="preview(item.FilePath)"> -->
                <div class="label-title label-title1">
                    <label>附件</label>
                </div>
                <div class="right-section">
                    <span>预览</span>
                    <x-icon type="ios-arrow-right"
                            size="20"
                            class="icon-right"></x-icon>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: '',
    data () {
        return {
            regImg: /\.(png|jpg|PNG|JPG|jpeg|JPEG|gif|GIF)$/
        }
    },
    methods: {
        preview (filePath) {
            if (this.regImg.test(filePath)) {
                this.$router.push({
                    path: '/previewImg',
                    query: {
                        previewImg: filePath
                    }
                })
            } else {
                wx.miniProgram.navigateTo({
                    url: `/pages/openDocument/index?filePath=${filePath}`
                })
            }
        }
    }
}
</script>
<style lang="less" scoped>
</style>
